package com.dongxing.concyrrency.chapter8;

/**
 * @author XavierDong
 **/
public class DeadLockTest {

    public static void main(String[] args) {
        DeadLock deadLock = new DeadLock();

        OtherService otherService = new OtherService(deadLock);
        deadLock.setOtherService(otherService);

        new Thread(){
            @Override
            public void run() {
                while (true) {
                    deadLock.m1();
                }
            }
        }.start();

        new Thread(){
            @Override
            public void run() {
                while (true) {
                    otherService.s2();
                }
            }
        }.start();


    }
}
